<article class="" id="post-">
<header class="entry-header">
<h1 class="entry-title">:target Selector</h1>
<div class="entry-meta">
						所属分类：<span class="category"><a href="/category/selectors/">选择器</a> &gt; <a href="/category/selectors/basic-filter-selectors/">基础过滤</a></span>
<span class="pull-right">英文文档：<a href="https://api.jquery123.com/target-selector/" target="_blank">:target Selector</a></span>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<!-- .entry-header -->
<div class="entry-content">
<article class="entry selector" id="target1"><h2 class="section-title"><span>target selector</span></h2>
<div class="entry-wrapper">
<p class="desc"><strong>描述: </strong>
			选择由文档URI的格式化识别码表示的目标元素。</p>
<ul class="signatures"><li class="signature"><h4 class="name">
<span class="version-details">添加的版本: <a href="/category/version/1.9/">1.9</a></span>jQuery( ":target" )</h4></li></ul>
<div class="longdesc" id="entry-longdesc">
<p>如果文档的URI包含一个格式化的标识符，或hash（哈希），
			然后<code>:target</code>选择器将匹配ID和标识符相匹配的元素。
			 例如，给定的URI http://example.com/#foo， <code>$( "p:target" )</code>，将选择<code>&lt;p id="foo"&gt;</code>元素。</p>
<p>这个不寻常的用法，可进一步讨论中找到
			 <a href="http://www.w3.org/TR/css3-selectors/#nth-child-pseudo">W3C CSS specification</a>.</p>
</div>
</div></article> </div>
</article>